Optimal. Leaf size=40 \[ -\frac {(c+d x) \tanh (e+f x)}{f}+c x+\frac {d \log (\cosh (e+f x))}{f^2}+\frac {d x^2}{2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.03, antiderivative size = 40, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3720, 3475} \[ -\frac {(c+d x) \tanh (e+f x)}{f}+c x+\frac {d \log (\cosh (e+f x))}{f^2}+\frac {d x^2}{2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3475
Rule 3720
Rubi steps
\begin {align*} \int (c+d x) \tanh ^2(e+f x) \, dx &=-\frac {(c+d x) \tanh (e+f x)}{f}+\frac {d \int \tanh (e+f x) \, dx}{f}+\int (c+d x) \, dx\\ &=c x+\frac {d x^2}{2}+\frac {d \log (\cosh (e+f x))}{f^2}-\frac {(c+d x) \tanh (e+f x)}{f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.25, size = 77, normalized size = 1.92 \[ \frac {c \tanh ^{-1}(\tanh (e+f x))}{f}-\frac {c \tanh (e+f x)}{f}+\frac {d \log (\cosh (e+f x))}{f^2}-\frac {d x \text {sech}(e) \sinh (f x) \text {sech}(e+f x)}{f}+\frac {d x \text {sech}(e) (f x \cosh (e)-2 \sinh (e))}{2 f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.50, size = 232, normalized size = 5.80 \[ \frac {d f^{2} x^{2} + 2 \, c f^{2} x + {\left (d f^{2} x^{2} + 2 \, {\left (c f^{2} - 2 \, d f\right )} x\right )} \cosh \left (f x + e\right )^{2} + 2 \, {\left (d f^{2} x^{2} + 2 \, {\left (c f^{2} - 2 \, d f\right )} x\right )} \cosh \left (f x + e\right ) \sinh \left (f x + e\right ) + {\left (d f^{2} x^{2} + 2 \, {\left (c f^{2} - 2 \, d f\right )} x\right )} \sinh \left (f x + e\right )^{2} + 4 \, c f + 2 \, {\left (d \cosh \left (f x + e\right )^{2} + 2 \, d \cosh \left (f x + e\right ) \sinh \left (f x + e\right ) + d \sinh \left (f x + e\right )^{2} + d\right )} \log \left (\frac {2 \, \cosh \left (f x + e\right )}{\cosh \left (f x + e\right ) - \sinh \left (f x + e\right )}\right )}{2 \, {\left (f^{2} \cosh \left (f x + e\right )^{2} + 2 \, f^{2} \cosh \left (f x + e\right ) \sinh \left (f x + e\right ) + f^{2} \sinh \left (f x + e\right )^{2} + f^{2}\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.15, size = 134, normalized size = 3.35 \[ \frac {d f^{2} x^{2} e^{\left (2 \, f x + 2 \, e\right )} + d f^{2} x^{2} + 2 \, c f^{2} x e^{\left (2 \, f x + 2 \, e\right )} + 2 \, c f^{2} x - 4 \, d f x e^{\left (2 \, f x + 2 \, e\right )} + 2 \, d e^{\left (2 \, f x + 2 \, e\right )} \log \left (e^{\left (2 \, f x + 2 \, e\right )} + 1\right ) + 4 \, c f + 2 \, d \log \left (e^{\left (2 \, f x + 2 \, e\right )} + 1\right )}{2 \, {\left (f^{2} e^{\left (2 \, f x + 2 \, e\right )} + f^{2}\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.11, size = 65, normalized size = 1.62 \[ \frac {d \,x^{2}}{2}+c x -\frac {2 d x}{f}-\frac {2 d e}{f^{2}}+\frac {2 d x +2 c}{f \left ({\mathrm e}^{2 f x +2 e}+1\right )}+\frac {d \ln \left ({\mathrm e}^{2 f x +2 e}+1\right )}{f^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.39, size = 127, normalized size = 3.18 \[ c {\left (x + \frac {e}{f} - \frac {2}{f {\left (e^{\left (-2 \, f x - 2 \, e\right )} + 1\right )}}\right )} - \frac {1}{2} \, d {\left (\frac {2 \, x e^{\left (2 \, f x + 2 \, e\right )}}{f e^{\left (2 \, f x + 2 \, e\right )} + f} - \frac {f x^{2} + {\left (f x^{2} e^{\left (2 \, e\right )} - 2 \, x e^{\left (2 \, e\right )}\right )} e^{\left (2 \, f x\right )}}{f e^{\left (2 \, f x + 2 \, e\right )} + f} - \frac {2 \, \log \left ({\left (e^{\left (2 \, f x + 2 \, e\right )} + 1\right )} e^{\left (-2 \, e\right )}\right )}{f^{2}}\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.09, size = 56, normalized size = 1.40 \[ x\,\left (c+\frac {d}{f}\right )+\frac {d\,x^2}{2}-\frac {d\,\ln \left (\mathrm {tanh}\left (e+f\,x\right )+1\right )}{f^2}-\frac {c\,\mathrm {tanh}\left (e+f\,x\right )}{f}-\frac {d\,x\,\mathrm {tanh}\left (e+f\,x\right )}{f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.25, size = 66, normalized size = 1.65 \[ \begin {cases} c x - \frac {c \tanh {\left (e + f x \right )}}{f} + \frac {d x^{2}}{2} - \frac {d x \tanh {\left (e + f x \right )}}{f} + \frac {d x}{f} - \frac {d \log {\left (\tanh {\left (e + f x \right )} + 1 \right )}}{f^{2}} & \text {for}\: f \neq 0 \\\left (c x + \frac {d x^{2}}{2}\right ) \tanh ^{2}{\relax (e )} & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________